package com.andyou.modules.content.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.andyou.common.persistence.Page;
import com.andyou.common.service.CrudService;
import com.andyou.modules.content.entity.ContentPublish;
import com.andyou.modules.content.dao.ContentPublishDao;

/**
 * 内容发布管理（content_publish）Service
 * @author lgx
 * @version 2020-03-08
 */
@Service
@Transactional(readOnly = true)
public class ContentPublishService extends CrudService<ContentPublishDao, ContentPublish> {

	public ContentPublish get(String id) {
		return super.get(id);
	}
	
	public List<ContentPublish> findList(ContentPublish contentPublish) {
		return super.findList(contentPublish);
	}
	
	public Page<ContentPublish> findPage(Page<ContentPublish> page, ContentPublish contentPublish) {
		return super.findPage(page, contentPublish);
	}
	
	@Transactional(readOnly = false)
	public int save(ContentPublish contentPublish) {
		return super.save(contentPublish);
	}
	
	@Transactional(readOnly = false)
	public void delete(ContentPublish contentPublish) {
		super.delete(contentPublish);
	}
	
	
    @Transactional(readOnly = false)
	public void batchDelete(List<String> idList) {
		ContentPublish contentPublish = null;
		for (String id : idList) {
			contentPublish = new ContentPublish();
			contentPublish.setId(id);
			super.delete(contentPublish);
		}
	}
}